from typing import Dict, Any

def get_dm_config() -> Dict[str, Any]:
    """获取达梦数据库的默认配置

    Returns:
        Dict[str, Any]: 默认配置字典
    """
    return {
        "db_type": "dm",
        "db_port": 5236,  # 达梦数据库默认端口
    }

def extend_site_config(config: Dict[str, Any]) -> Dict[str, Any]:
    """扩展站点配置

    Args:
        config: 原始配置

    Returns:
        Dict[str, Any]: 扩展后的配置
    """
    if config.get("db_type") == "dm":
        dm_config = get_dm_config()
        # 只在没有设置的情况下使用默认值
        for key, value in dm_config.items():
            if key not in config:
                config[key] = value
    return config 